package com.xiaoxi.abstractfactorymode.listfactory;

import com.xiaoxi.abstractfactorymode.factory.IItem;
import com.xiaoxi.abstractfactorymode.factory.ITray;

/**
 * @ClassName IGray
 * @Description
 * @Author xiaoxi
 * @Date 2023/3/12 21:59
 * @Version 1.0
 */
public class ListGray extends ITray {

    public ListGray(String caption) {
        super(caption);
    }

    @Override
    public String makeHTML() {
        StringBuilder sb = new StringBuilder();
        sb.append("<li>\n");
        sb.append(caption).append("\n");
        sb.append("<ul>\n");
        for(IItem iItem : iItemList) {
            sb.append(iItem.makeHTML());
        }
        sb.append("</ul>\n");
        sb.append("</li>\n");
        return sb.toString();
    }
}
